<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/6/006
 * Time: 8:57
 */

namespace app\api\model;


class AttrValue extends BaseModel {

    public function getImageAttr($value) {
        return get_img_url($value);
    }

    /**
     * 根据ID获取属性值列表
     * @param $ids
     * @return array|\PDOStatement|string|\think\Collection
     */
    public static function getAttrValueByIds($ids) {
        $attr_value = self::where('id', 'in', $ids)->select();
        return $attr_value;
    }

    /**
     * 获取属性值名称
     * @param $ids
     * @return array
     */
    public static function getAttrValueNameByIds($ids) {
        $attr_values = self::where('id', 'in', $ids)->column('name');
        return $attr_values;
    }
}